home *** CD-ROM | disk | FTP | other *** search
/ Carousel / CAROUSEL.cdr / mactosh / john / hc_model.hqx / Dialog Stack1.6 / card_2972.txt < prev    next >
Encoding:
Text File  |  1989-09-03  |  19.2 KB  |  612 lines

  1. -- card: 2972 from stack: in.6
  2. -- bmap block id: 3529
  3. -- flags: 0000
  4. -- background id: 2660
  5. -- name: 
  6.  
  7.  
  8. -- part 1 (field)
  9. -- low flags: 81
  10. -- high flags: 0007
  11. -- rect: left=123 top=0 right=342 bottom=512
  12. -- title width / last selected line: 0
  13. -- icon id / first selected line: 0 / 0
  14. -- text alignment: 0
  15. -- font id: 4
  16. -- text size: 9
  17. -- style flags: 0
  18. -- line height: 12
  19. -- part name: help
  20.  
  21.  
  22. -- part 2 (button)
  23. -- low flags: 00
  24. -- high flags: A004
  25. -- rect: left=17 top=36 right=58 bottom=117
  26. -- title width / last selected line: 0
  27. -- icon id / first selected line: 0 / 0
  28. -- text alignment: 1
  29. -- font id: 0
  30. -- text size: 12
  31. -- style flags: 0
  32. -- line height: 16
  33. -- part name: Let's try
  34. ----- HyperTalk script -----
  35. on MouseUp
  36.  
  37.   -- First, remember to get these global variable
  38.   -- These Xcmd/Xcfn NEED them !
  39.  
  40.   global MyDlog
  41.   put ModDialog (500) into MyDlog -- 500 is the ID number of the resource.
  42.   if MyDlog is "0"  then  -- parameter list error
  43.     answer "Parameter error"
  44.     exit to HyperCard
  45.   end if
  46.   if MyDlog is "-1" then -- resource not found
  47.     answer "Resource not found."
  48.     exit to HyperCard
  49.   end if
  50.  
  51.   -- First, we need to initialize the state of checkBoxes,
  52.   -- Radio-buttons and others editable texts.
  53.   SetDialog MyDlog,5,1 -- Hilite the first radio-button
  54.   ParamDialog MyDlog,"","","","" -- put empty into paramtexts.
  55.   -- put the username in editable text
  56.   global UserName
  57.   SetDialog MyDlog,18,UserName
  58.  
  59.   -- Here are the item numbers of check-boxes and radioButtons of this ditl
  60.   put "5,6,7,8,9" into RadButtons
  61.   put "10,11" into CheckButtons
  62.   put 0 into LastClick -- this is for a little joke...
  63.  
  64.  
  65.   set cursor to arrow
  66.   put true into OK -- used during the exit repeat
  67.   -- Now, a loop for handling events in this dlog :
  68.  
  69.   repeat
  70.  
  71.     put HandleDialog(MyDlog) into UserClic
  72.     if UserClic is 1 then -- click on OK
  73.       exit repeat
  74.     else if UserClic is 2 then -- click on Cancel
  75.       set cursor to watch
  76.       ParamDialog MyDlog,"Cancelling...","","",""
  77.       wait 2 seconds
  78.       put false into OK
  79.       exit repeat
  80.     else if UserClic is in RadButtons then
  81.       repeat with i is 5 to 9
  82.         SetDialog MyDlog,i,0
  83.       end repeat
  84.       SetDialog MyDlog,UserClic,1
  85.     else if UserClic is in CheckButtons then
  86.       if DialogValue(MyDlog,UserClic) is 1 then
  87.         SetDialog MyDlog,UserClic,0
  88.       else
  89.         SetDialog MyDlog,UserClic,1
  90.       end if
  91.     else if UserClic is 12 then -- click on picture
  92.       Add 1 to LastClick
  93.       if LastClick is 5 then put 1 into LastClick
  94.       Joke (LastClick)
  95.     end if
  96.   end repeat
  97.   -- Read the actual state of all controls :
  98.   -- RAdio-buttons :
  99.   repeat with i is 5 to 9
  100.     if DialogValue(MyDlog,i) is 1 then
  101.       put i into RadBtnValue
  102.       exit repeat
  103.     end if
  104.   end repeat
  105.   -- Check-boxes :
  106.   put false into firsCheck
  107.   put false into SndCheck
  108.   if DialogValue(MyDlog,10) is 1 then put true into firsCheck
  109.   if DialogValue(MyDlog,11) is 1 then put true into SndCheck
  110.   -- Editable text :
  111.   put DialogValue(MyDlog,18) into NameOfUser
  112.  
  113.   -- Now, we need to release the dialog :
  114.   DisDialog MyDlog
  115.   if OK is true then
  116.     put RadBtnValue after line 4 of card field 2
  117.     if firsCheck is true then
  118.       put " on" after line 5 of card field 2
  119.     else
  120.       put " off" after line 5 of card field 2
  121.     end if
  122.     if sndCheck is true then
  123.       put "on" after line 6 of card field 2
  124.     else
  125.       put "off" after line 6 of card field 2
  126.     end if
  127.     put NameOfUser after line 7 of card field 2
  128.     show card field 2
  129.   end if
  130. end MouseUp
  131.  
  132. on Joke arg
  133.   global MyDlog
  134.   if arg is 1 then
  135.     ParamDialog MyDlog,"Ouch !","","",""
  136.   else if arg is 2 then
  137.     ParamDialog MyDlog,"Ouch !","I Said : Ouch !","",""
  138.   else if arg is 3 then
  139.     ParamDialog MyDlog,"Ouch !","I Said : Ouch !","Little joker, hum ?",""
  140.   else if arg is 4 then
  141.     ParamDialog MyDlog,"Ouch !","I Said : Ouch !","Little joker, hum ?","You're despictable!"
  142.   end if
  143. end Joke
  144.  
  145.  
  146.  
  147. -- part 3 (button)
  148. -- low flags: 00
  149. -- high flags: A004
  150. -- rect: left=17 top=63 right=85 bottom=117
  151. -- title width / last selected line: 0
  152. -- icon id / first selected line: 0 / 0
  153. -- text alignment: 1
  154. -- font id: 0
  155. -- text size: 12
  156. -- style flags: 0
  157. -- line height: 16
  158. -- part name: Help Me !
  159. ----- HyperTalk script -----
  160. on mouseUp
  161.   if the visible of card field 1 is false then
  162.     show card field 1
  163.     set the name of the target to "Hide it!"
  164.     repeat with i is 3 to 9
  165.       show card button i
  166.     end repeat
  167.   else
  168.     hide card field 1
  169.     set the scroll of card field 1 to 0
  170.     set the name of the target to "Help Me !"
  171.     repeat with i is 3 to 9
  172.       hide card button i
  173.     end repeat
  174.   end if
  175. end mouseUp
  176.  
  177.  
  178.  
  179. -- part 4 (button)
  180. -- low flags: 80
  181. -- high flags: A004
  182. -- rect: left=18 top=169 right=191 bottom=118
  183. -- title width / last selected line: 0
  184. -- icon id / first selected line: 0 / 0
  185. -- text alignment: 1
  186. -- font id: 0
  187. -- text size: 12
  188. -- style flags: 0
  189. -- line height: 16
  190. -- part name: ModDialog
  191. ----- HyperTalk script -----
  192. on mouseUp
  193.   set the scroll of card field 1 to 540
  194. end mouseUp
  195.  
  196.  
  197.  
  198. -- part 5 (button)
  199. -- low flags: 80
  200. -- high flags: A004
  201. -- rect: left=18 top=215 right=237 bottom=118
  202. -- title width / last selected line: 0
  203. -- icon id / first selected line: 0 / 0
  204. -- text alignment: 1
  205. -- font id: 0
  206. -- text size: 12
  207. -- style flags: 0
  208. -- line height: 16
  209. -- part name: DisDialog
  210. ----- HyperTalk script -----
  211. on mouseUp
  212.   set the scroll of card field 1 to 1200
  213. end mouseUp
  214.  
  215.  
  216.  
  217. -- part 6 (button)
  218. -- low flags: 80
  219. -- high flags: A004
  220. -- rect: left=18 top=192 right=214 bottom=118
  221. -- title width / last selected line: 0
  222. -- icon id / first selected line: 0 / 0
  223. -- text alignment: 1
  224. -- font id: 0
  225. -- text size: 12
  226. -- style flags: 0
  227. -- line height: 16
  228. -- part name: HandleDialog
  229. ----- HyperTalk script -----
  230. on mouseUp
  231.   set the scroll of card field 1 to 804
  232. end mouseUp
  233.  
  234.  
  235.  
  236. -- part 7 (button)
  237. -- low flags: 80
  238. -- high flags: A004
  239. -- rect: left=18 top=261 right=283 bottom=118
  240. -- title width / last selected line: 0
  241. -- icon id / first selected line: 0 / 0
  242. -- text alignment: 1
  243. -- font id: 0
  244. -- text size: 12
  245. -- style flags: 0
  246. -- line height: 16
  247. -- part name: SetDialog
  248. ----- HyperTalk script -----
  249. on mouseUp
  250.   set the scroll of card field 1 to 1740
  251. end mouseUp
  252.  
  253.  
  254.  
  255. -- part 8 (button)
  256. -- low flags: 80
  257. -- high flags: A004
  258. -- rect: left=18 top=238 right=260 bottom=118
  259. -- title width / last selected line: 0
  260. -- icon id / first selected line: 0 / 0
  261. -- text alignment: 1
  262. -- font id: 0
  263. -- text size: 12
  264. -- style flags: 0
  265. -- line height: 16
  266. -- part name: DialogValue
  267. ----- HyperTalk script -----
  268. on mouseUp
  269.   set the scroll of card field 1 to 1440
  270. end mouseUp
  271.  
  272.  
  273.  
  274. -- part 9 (button)
  275. -- low flags: 80
  276. -- high flags: A004
  277. -- rect: left=18 top=285 right=307 bottom=118
  278. -- title width / last selected line: 0
  279. -- icon id / first selected line: 0 / 0
  280. -- text alignment: 1
  281. -- font id: 0
  282. -- text size: 12
  283. -- style flags: 0
  284. -- line height: 16
  285. -- part name: ParamDialog
  286. ----- HyperTalk script -----
  287. on mouseUp
  288.   set the scroll of card field 1 to 2064
  289. end MouseUp
  290.  
  291.  
  292.  
  293. --on mouseUp
  294. put ModDialog(505) into AboutDialog
  295. put HandleDialog(AboutDialog) into UserClic
  296. disDialog(AboutDialog)
  297. --end mouseUp
  298.  
  299.  
  300.  
  301. -- part 27 (button)
  302. -- low flags: 80
  303. -- high flags: A004
  304. -- rect: left=18 top=308 right=330 bottom=118
  305. -- title width / last selected line: 0
  306. -- icon id / first selected line: 0 / 0
  307. -- text alignment: 1
  308. -- font id: 0
  309. -- text size: 12
  310. -- style flags: 0
  311. -- line height: 16
  312. -- part name: Skeleton╔
  313. ----- HyperTalk script -----
  314. on mouseUp
  315.   set the scroll of card field 1 to 2472
  316. end MouseUp
  317.  
  318.  
  319.  
  320. --on mouseUp
  321. put ModDialog(505) into AboutDialog
  322. put HandleDialog(AboutDialog) into UserClic
  323. disDialog(AboutDialog)
  324. --end mouseUp
  325.  
  326.  
  327.  
  328. -- part 28 (button)
  329. -- low flags: 00
  330. -- high flags: A004
  331. -- rect: left=18 top=90 right=112 bottom=118
  332. -- title width / last selected line: 0
  333. -- icon id / first selected line: 0 / 0
  334. -- text alignment: 1
  335. -- font id: 0
  336. -- text size: 12
  337. -- style flags: 0
  338. -- line height: 16
  339. -- part name: About...
  340. ----- HyperTalk script -----
  341. on mouseUp
  342.   put ModDialog(505) into AboutDialog
  343.   put HandleDialog(AboutDialog) into UserClic
  344.   disDialog(AboutDialog)
  345. end mouseUp
  346.  
  347.  
  348.  
  349. -- part 29 (field)
  350. -- low flags: 81
  351. -- high flags: 0004
  352. -- rect: left=34 top=118 right=288 bottom=489
  353. -- title width / last selected line: 0
  354. -- icon id / first selected line: 0 / 0
  355. -- text alignment: 1
  356. -- font id: 0
  357. -- text size: 12
  358. -- style flags: 0
  359. -- line height: 16
  360. -- part name: 
  361. ----- HyperTalk script -----
  362. on mouseUp
  363.   hide the target
  364.   repeat with i is 4 to 7
  365.     put empty into last word of line i of the target
  366.   end repeat
  367.  
  368. end MouseUp
  369.  
  370.  
  371.  
  372. -- part contents for card part 1
  373. ----- text -----
  374. These externals are ┬⌐ 89, Antoine Latour. They are free, and your are allowed to  distribute them in public domain products, if the line : "Externals ModDialog, DisDialog, HandleDialog, SetDialog, DialogValue & ParamDialog are ┬⌐ 89, Antoine Latour" appears clearly in your stacks. For any commercial products, please contact me at the following adress :
  375. Antoine Latour, 11, rue du Mai 1945, 91150 Etampes, France.
  376. Others contact : AppleLink TECH.SUPT.FR (Atn A.LATOUR), CalvaCom AA49.
  377.  
  378. In order to use dialogs in Hypercard stacks, i've implemented larges parts of the dialog manager in these six externals :
  379. ΓÇó ModDialog, which bring up a dialog window on the screen;
  380. ΓÇó DisDialog, which dispose it;
  381. ΓÇó HandleDialog, which return you the item choosen by the user;
  382. ΓÇó DialogValue, which return the value or the state of an item of the dialog item list;
  383. ΓÇó SetDialog, which allow you to change the state or the value of an item of the dialog item list;
  384. ΓÇó ParamDialog, which allow you to change the text displayed by a dialog.
  385.  
  386. To use these commands, you need a good knowledge of the dialog manager of the Macintosh. See Inside Macintosh Vol I and III.
  387.  
  388. The first thing you've to do is to design your dialog. You can use ResEdit, Rmaker or other software to create them. If you use ResEdit, create a new file, then create a new DLOG resource. Warning : the visible attribute may be set to true, RefCon may be set to 0. All other attributes, in particular GoAwayFlag, may be set to false. 
  389. Once your dialog is designed, with it's item list, you've to note carrefully :  the ID number of the DLOG, and the item number of all of the items. Usually, item 1 may be the OK button of the dialog.
  390. Then, you've to past the DLOG, the DITL, and all other associated resources ( PICT, ICON, etc.. ) into your stack.
  391.  
  392. Remember this : In order to work, all of these commands need a parameter, given you by the ModDialog function. Put this parameter in a global variable, and declare it at any point of your script.
  393.  
  394.  
  395. ModDialog < ID >
  396. ΓÇôΓÇôΓÇôΓÇôΓÇôΓÇôΓÇôΓÇôΓÇôΓÇôΓÇôΓÇôΓÇôΓÇôΓÇôΓÇô
  397. ModDialog is a function which look in your stack, then in your home stack, then in HyperCard himself, at least in the system file, to find the dialog specified in the ID parameter. Then, he brings its on the screen, and return the pointer on it. YOU NEED to collect this pointer into a variable, for all others calls to theses commands.
  398.  
  399. Example :
  400.  
  401.  on Bring_up_dialog
  402.     global MyDialog
  403.     put ModDialog (500) into MyDialog
  404. end Bring_up_dialog
  405.  
  406. In Case of error, the value returned by ModDialog may be :
  407.  * 0 if the parameter passed to ModDialog is non-coherent;
  408.  * -1, if the resource doesn't exists.
  409. Obviously, in both of these cases, ModDialog doesn't show any dialog on the screen.
  410.  
  411. HandleDialog <pointer>
  412. ΓÇôΓÇôΓÇôΓÇôΓÇôΓÇôΓÇôΓÇôΓÇôΓÇôΓÇôΓÇôΓÇôΓÇôΓÇôΓÇôΓÇôΓÇôΓÇôΓÇôΓÇôΓÇô
  413. HandleDIalog is a function that return the item number choosen by the user. Its a one-event function. In most cases, you must call HandleDialog along a repeat loop, and you will exit this loop when the 'OK' or 'Cancel' button will be choose. HandleDialog return an integer, between 1 and 64 ( the maximum number of items in a DITL ). 
  414.  
  415. Example :
  416.  
  417. on Test_Dialog
  418.     global MyDialog
  419.     repeat
  420.         put HandleDialog(MyDialog) into UserAnswer
  421.         if UserAnswer is 1 then -- OK Button
  422.           exit repeat
  423.         else if UserAnswer is 2 then -- Cancel button
  424.           exit to HyperCard
  425.         end if
  426.     end repeat
  427.     -- here is the script wich look for the value of differents items
  428.     -- after that, you have to use DisDIalog to put away the dialog
  429. end Test_Dialog
  430.  
  431. NOTE : Only enabled items can be seen by ModDialog. See your DITL with resEdit to Enable ou disable your item.
  432. CAUTION : A call to HandleDIalog with a <pointer> parameter which doesn't exist will cause a system error.
  433.  
  434.  
  435. DisDialog <pointer>
  436. ΓÇôΓÇôΓÇôΓÇôΓÇôΓÇôΓÇôΓÇôΓÇôΓÇôΓÇôΓÇôΓÇôΓÇôΓÇôΓÇôΓÇôΓÇôΓÇô
  437. Giving a pointer on a dialog, DisDialog release it off the screen, releasing also the memory occupied by the dialog and item list structures.
  438.  
  439. Example :
  440.     On Bring_off_dialog
  441.         Global MyDialog
  442.         DisDialog MyDialog
  443.     end Bring_off_dialog
  444.  
  445. CAUTION :  Only two tests are made  : DisDialog check if the <pointer> parameter is 0 or odd. In these cases, DisDialog do nothing. But if you give it a non-zero and even parameter, which doesn't correspont to a dialog pointer, the crash will be awfull !
  446.  
  447.  
  448.  
  449. DialogValue <Pointer>,<item>
  450. ΓÇôΓÇôΓÇôΓÇôΓÇôΓÇôΓÇôΓÇôΓÇôΓÇôΓÇôΓÇôΓÇôΓÇôΓÇôΓÇôΓÇôΓÇôΓÇôΓÇôΓÇôΓÇôΓÇôΓÇôΓÇôΓÇôΓÇôΓÇô
  451. Giving a pointer on a dialog, and an item number of the item list, DialogValue return the value or the state of this item, depending of what kind of item you're speaking about. If the <item> is a check-box or a radio-button, DialogValue return 1 or 0, depending if the control is highlighed or not. If the item is a button, a staticText, or editableText, dialogValue give you the text of this control. If the item is a userItem or an icon, DialogValue do nothing. If the <item> parameter doesn't correpond to an item existing in the dialog, DisDialog will return '0' as its value. 
  452.  
  453. Example :
  454.  
  455.     On What_Value
  456.         global MyDialog
  457.         put DialogValue (MyDialog,1) into ValueOfFirstItem
  458.         put DialogValue (MyDialog,2) into ValueOfSecondItem
  459.     end What_Value
  460.  
  461. CAUTION : Calling DialogValue with a <pointer> parameter wich doesn't exist may be... special.
  462.  
  463.  
  464. SetDialog <pointer>, <Item>, <[state][value]>
  465. ΓÇôΓÇôΓÇôΓÇôΓÇôΓÇôΓÇôΓÇôΓÇôΓÇôΓÇôΓÇôΓÇôΓÇôΓÇôΓÇôΓÇôΓÇôΓÇôΓÇôΓÇôΓÇôΓÇôΓÇôΓÇôΓÇôΓÇôΓÇôΓÇôΓÇôΓÇôΓÇôΓÇôΓÇôΓÇôΓÇôΓÇôΓÇôΓÇôΓÇôΓÇôΓÇôΓÇôΓÇôΓÇô
  466. Given a pointer on a dialog, and an item number of the item list, SetDialog will set a value or a state to the item, depending of what king of item you're speaking about. If the <Item> is a check-box or a radio-button, SetDialog will set the item to highlighed or not. In this case, you will use 1 or 0 in the third parameter, with 1 to highligh to item. If the <item> is a static-text, editable-text, or a button, SetDialog will set the test of this item to [value], which is a sample string. Only first 255 caracters will be used.
  467.  
  468.  
  469. Examples :
  470.  
  471.   On Set_Item
  472.      -- set a checkbox ( item 3 of the DITL ) to on
  473.      global MyDialog
  474.      SetDialog MyDlog,3,1
  475.   end Set_Item
  476.  
  477.   on Set_Item
  478.      -- set a static-text ( item 3 of the DITL ) to a string
  479.      global MyDialog
  480.      SetDialog MyDlog,3,"Hello,World !"
  481.   end Set_Item
  482.  
  483. ParamDialog <pointer>,<Text1>,<Text2>,<Text3>,<Text4>
  484. ΓÇôΓÇôΓÇôΓÇôΓÇôΓÇôΓÇôΓÇôΓÇôΓÇôΓÇôΓÇôΓÇôΓÇôΓÇôΓÇôΓÇôΓÇôΓÇôΓÇôΓÇôΓÇôΓÇôΓÇôΓÇôΓÇôΓÇôΓÇôΓÇôΓÇôΓÇôΓÇôΓÇôΓÇôΓÇôΓÇôΓÇôΓÇôΓÇôΓÇôΓÇôΓÇôΓÇôΓÇôΓÇôΓÇôΓÇôΓÇôΓÇôΓÇôΓÇôΓÇôΓÇô
  485. ParamDialog provides a means of substituting text in statText items: Text1 through Text3 will replace the special strings '^0' through '^3' in all statText items in subsequent dialog, notified in the <pointer> parameter. Pass empty strings for parameters not used.
  486.  
  487. Example :
  488.  
  489.    on ParamText
  490.      global MyDialog
  491.      ParamDialog MyDialog,"first text","second text",&┬¼
  492.      "third text","fourth text"
  493.    end ParamText
  494.  
  495. If you want to put only the third line :
  496.        ParamDialog MyDilaog,"","","third texte",""
  497.  
  498. NOTE : you must specify the four text parameter, empty or not; If you want to change only
  499. one of the four lines, you must pass the full four line as parameter :
  500.  
  501.    on ParamText
  502.      global MyDialog
  503.      ParamDialog MyDialog,"first text","second text",&┬¼
  504.      "third text","fourth text"
  505.      wait 3 seconds
  506.      ParamDialog MyDialog,"first text",&┬¼
  507.      "second text changed","third text","fourth text"
  508.    end ParamText
  509.  
  510.  
  511. A Script skeleton
  512. ΓÇôΓÇôΓÇôΓÇôΓÇôΓÇôΓÇôΓÇôΓÇôΓÇôΓÇôΓÇôΓÇôΓÇôΓÇôΓÇôΓÇô
  513.  
  514. During the repeat ... HandleDialog ... end repeat loop, user may click in check-boxes or radio-button. If there is more of 2 radio-button in a group, you must switch off all radio-buttons first, then highligh the radio-button the user choose. I recommend to use this kind of script :
  515.  
  516.    On Display_Dialog
  517.      global MyDialog
  518.      -- Display the dialog first
  519.      put ModDialog (500) into MyDialog
  520.      -- test if the dialog is displayed or not
  521.      if  MyDialog is 0 then exit to hypercard
  522.      if MyDialog is -1 then exit to hypercard
  523.  
  524.      -- In this dlog, there is two distincts group of radio-     
  525.      -- button, and a group of 2 check-boxes. Only one of 
  526.      -- radio-button of each group must be highligh. We --
  527.      -- create two series of radio-button :
  528.      -- item number of the radio-btn of first group :
  529.      put "3,4,5" into RadButtons1
  530.      -- item numbers of the radio-btn of second group :
  531.      put "6,7,8" into RadButtons2
  532.  
  533.      -- item numbers of the two check-boxes :
  534.      put "9,10" into CheckBoxes
  535.  
  536.      -- repeat loop
  537.      repeat
  538.       put HandleDialog(MyDialog) into userClic
  539.      if userClic is in RadButtons1 then
  540.        -- user clic in first group of radio-buttons
  541.        -- first, switch off all these radio-buttons :
  542.        repeat with i is 3 to 5
  543.          SetDialog MyDialog,i,0
  544.        end repeat
  545.        -- then we highligh the radio-button choosen
  546.        SetDialog MyDialog,UserClic,1
  547.       end if
  548.       if userClic is in RadButtons2 then
  549.        -- user clic in second group of radio-buttons
  550.        -- first, switch off all these radio-buttons :
  551.        repeat with i is 6 to 8
  552.          SetDialog MyDialog,i,0
  553.        end repeat
  554.        -- then we highligh the radio-button choosen
  555.        SetDialog MyDialog,UserClic,1
  556.       end if
  557.       if userClic is in CheckBoxes
  558.         -- user clic in a check-boxe. Is it actually
  559.         -- highligh or not ?
  560.         if DialogValue(MyDialog,UserClic) is O then
  561.           -- not hilight, so we select it
  562.           SetDialog MyDialog,UserClic,1
  563.          else
  564.           -- if it's highlighed, we switch it off
  565.          SetDialog MyDialog,UserClic,0
  566.        end if
  567.      end if
  568.      if userClic is 1 then exit repeat -- ok button
  569.    end repeat
  570.   -- Here is the script wich allow us to see what's button a   
  571.   -- selected :
  572.   repeat with i is 3 to 5
  573.    if DialogValue(MyDialog,i) is 1 then
  574.      put i into FirstGroupChoice
  575.    end if
  576.   end repeat
  577.   repeat with i is 6 to 8
  578.    if DialogValue(MyDialog,i) is 1 then
  579.     put i into SecondGroupChoice
  580.    end if
  581.   end repeat
  582.   -- Now, the item number of each radio-button group
  583.   -- currently selected are stored in the variables
  584.   -- 'firstGroupChoice' and 'SecondGroupChoice'
  585.   -- Look for the checkBoxes
  586.   if DialogValue(MyDialog,9) is 1 then put true into ┬¼
  587.   FirstBox
  588.   if dialogValue(MyDialog,10) is 1 the put true into ┬¼  
  589.   SecondBox
  590.  
  591.   -- Now, we dispose the dialog :
  592.   DisDialog (MyDialog)
  593. end Display_dialog
  594.  
  595. See the script of card button 'Let's try' of this stack for more infos.
  596. I apologize for my 'non-fluent' english. But why don't you speak french as everybody does ?
  597.  
  598. -- part contents for card part 29
  599. ----- text -----
  600.  
  601. You've choose :
  602.  
  603. The radio-button selected was the 
  604. The first check-box was      
  605. and the second was  
  606. The name of the user is : Paul Paul 
  607.  
  608. click anywhere on this field to hide it.
  609.  
  610.  
  611.  
  612.